home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / asm_msc1.arc / AUTODATE.DOC < prev    next >
Text File  |  1988-11-20  |  3KB  |  66 lines

  1.   AUTODATE
  2.   ========
  3.      The AUTODATE program maintains a date file which is used to supply
  4.      the date and time for the system after a System Restart is performed.
  5.      There are four files involved:
  6.        AUTODATE.ASM  - Assembly source
  7.        AUDODATE.BAS  - BASIC version
  8.        AUTODATE.DAT  - The Date file, required
  9.        AUTODATE.COM  - Assembled and linked, executable module
  10.  
  11.      The date file is named AUTODATE.DAT and consists of two records, one
  12.      with the current date in the form MM-DD-YYYY, and the second with the
  13.      current time in the form HH:MM:SS. The program does not create the
  14.      date file, so use EDLIN (or similar program) to allocate it.
  15.  
  16.      When the program is invoked, it obtains the current date and time
  17.      from DOS. If the date is 01-01-1980, a power-on is assumed and a new
  18.      date and time is read from the DAT file. Otherwise, the current DOS
  19.      values are used. To run the program after System Restart, place the
  20.      command AUTODATE into the AUTOEXEC.BAT file.
  21.  
  22.      The user is prompted for the date and time, just as if the DATE and
  23.      TIME commands had been used. Pressing the ENTER key tells the program
  24.      to use the displayed value. An incorrect value (bad syntax, etc)
  25.      generates an error message and a new prompt. Control-break can be used
  26.      to exit the program. Supply the date/time values with leading digits.
  27.           Enter new date: 11-02-1983
  28.           Enter new time: 12:15:30
  29.  
  30.      A useful feature of this program is its forgiving nature (simple minded).
  31.      Either the DATE and/or TIME may be supplied with only one digit. For
  32.      example,
  33.          Enter new date:  11-02
  34.          Enter new time:  12:20
  35.  
  36.      and thereby cut down on key strokes a bit. Leading zeros must be entered.
  37.                         =============================
  38.  
  39.      The program began as a BASIC program, but the Assembler version is
  40.      more econimical in terms of disk space, etc.
  41.  
  42.   01 ' AUTODATE.BAS
  43.   10 CLS : CLOSE
  44.   20 ON ERROR GOTO 90
  45.   30 DD$=DATE$ : TT$=TIME$ : IF MID$(DD$,1,10)<>"01-01-1980" THEN GOTO 90
  46.   40 OPEN "AUTODATE.DAT" FOR INPUT AS #1
  47.   50 IF EOF(1) GOTO 80 : ON ERROR GOTO 80
  48.   60 LINE INPUT #1,DD$ : DATE$=MID$(DD$,6,10)
  49.   70 LINE INPUT #1,TT$ : TIME$=MID$(TT$,6,8)
  50.   80 CLOSE #1
  51.   90 PRINT "The date is ",DATE$
  52.   100 INPUT "Enter date: ",D$
  53.   110 IF LEN(D$)>0 THEN DATE$=D$
  54.   120 PRINT "The time is ",TIME$
  55.   130 INPUT "Enter time: ",T$
  56.   140 IF LEN(T$)>0 THEN TIME$=T$
  57.   150 OPEN "AUTODATE.DAT" FOR OUTPUT AS #1
  58.   160 DD$=DATE$ : TT$=TIME$
  59.   170 PRINT #1,"DATE=";DD$
  60.   180 PRINT #1,"TIME=";TT$
  61.   190 CLOSE #1
  62.   200 END
  63.  
  64.  Written by Vern Buerg for public domain use, October, 1983.
  65.  
  66.